package com.hzc.springchan.strategy.requestlog.impl;

import com.hzc.springchan.bean.request.Request;
import com.hzc.springchan.constant.System;
import com.hzc.springchan.strategy.requestlog.IRequestLogStrategy;
import com.hzc.springchan.util.JSONUtils;
import org.aspectj.lang.JoinPoint;
import org.springframework.stereotype.Service;

/**
 * delete类型请求参数日志打印策略类
 * @author chen990627
 * @date 2022/10/18
 */
@Service(System.RequestLogStrategy.DELETE)
public class DeleteRequestLogStrategy implements IRequestLogStrategy {

    @Override
    public void requestLog(JoinPoint joinPoint) {

        Object[] arguments = joinPoint.getArgs();
        Request request = (Request) arguments[0];
        log("DELETE: " + JSONUtils.toJSON(request));
    }
}
